import pymongo

#建立mongodb的连接，实例化一个mongodb对象
uri = "mongodb://%s:%s@%s:%s"%('root','root','localhost',27017)
client = pymongo.MongoClient(uri)
db = client.get_database('气象台')
col = db.get_collection('气象资产')
print(col)
doc = col.find()
for d in doc:
    print(d)
